package fengstyle.stock;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class StockController {

    @Autowired
    private StockService service;

    @GetMapping("/stock/add")
    public void addStock(Integer id, String no, String userName){
        Stock order = new Stock();
        order.setId(id);
        order.setNo(no);
        order.setUserName(userName);
        service.addStock(order);
    }

    @GetMapping("/stock/addException")
    public void addStockException(Integer id, String no, String userName){
        Stock order = new Stock();
        order.setId(id);
        order.setNo(no);
        order.setUserName(userName);
        service.addStockException(order);
    }

}
